n,m=input().split(' ')
n=int(n)
m=int(m)
for i in range(0,n):
    sum = 0
    s=input().split(' ')
    for j in s:
        sum+=eval(j)
    print(sum)
